window.onload = function(){
    layui.use('table', function(){
        var table = layui.table;
        
        //展示已知数据
        table.render({
          elem: '#demo'
          ,cols: [[ //标题栏
            {field: 'id', title: 'ID', width: 80, sort: true}
            ,{field: 'username', title: '用户名', width: 120}
            ,{field: 'email', title: '邮箱', minWidth: 150}
            ,{field: 'sign', title: '签名', minWidth: 160}
            ,{field: 'sex', title: '性别', width: 80}
            ,{field: 'city', title: '城市', width: 100}
            ,{field: 'experience', title: '工时', width: 80, sort: true}
          ]]
          ,data: [{
            "id": "01"
            ,"username": "杜甫"
            ,"email": "1号车间"
            ,"sex": "男"
            ,"city": "浙江杭州"
            ,"sign": "人生恰似一场修行"
            ,"experience": "116"
            ,"ip": "192.168.0.8"
            ,"logins": "108"
            ,"joinTime": "2016-10-14"
          }, {
            "id": "02"
            ,"username": "李白"
            ,"email": "1号车间"
            ,"sex": "男"
            ,"city": "浙江杭州"
            ,"sign": "人生恰似一场修行"
            ,"experience": "12"
            ,"ip": "192.168.0.8"
            ,"logins": "106"
            ,"joinTime": "2016-10-14"
            ,"LAY_CHECKED": true
          }, {
            "id": "03"
            ,"username": "王勃"
            ,"email": "1号车间"
            ,"sex": "男"
            ,"city": "浙江杭州"
            ,"sign": "人生恰似一场修行"
            ,"experience": "65"
            ,"ip": "192.168.0.8"
            ,"logins": "106"
            ,"joinTime": "2016-10-14"
          }, {
            "id": "04"
            ,"username": "贤心"
            ,"email": "1号车间"
            ,"sex": "男"
            ,"city": "浙江杭州"
            ,"sign": "人生恰似一场修行"
            ,"experience": "666"
            ,"ip": "192.168.0.8"
            ,"logins": "106"
            ,"joinTime": "2016-10-14"
          }, {
            "id": "05"
            ,"username": "贤心"
            ,"email": "1号车间"
            ,"sex": "男"
            ,"city": "浙江杭州"
            ,"sign": "人生恰似一场修行"
            ,"experience": "86"
            ,"ip": "192.168.0.8"
            ,"logins": "106"
            ,"joinTime": "2016-10-14"
          }, {
            "id": "06"
            ,"username": "贤心"
            ,"email": "1号车间"
            ,"sex": "男"
            ,"city": "浙江杭州"
            ,"sign": "人生恰似一场修行"
            ,"experience": "12"
            ,"ip": "192.168.0.8"
            ,"logins": "106"
            ,"joinTime": "2016-10-14"
          }, {
            "id": "07"
            ,"username": "贤心"
            ,"email": "1号车间"
            ,"sex": "男"
            ,"city": "浙江杭州"
            ,"sign": "人生恰似一场修行"
            ,"experience": "16"
            ,"ip": "192.168.0.8"
            ,"logins": "106"
            ,"joinTime": "2016-10-14"
          }, {
            "id": "08"
            ,"username": "贤心"
            ,"email": "1号车间"
            ,"sex": "男"
            ,"city": "浙江杭州"
            ,"sign": "人生恰似一场修行"
            ,"experience": "106"
            ,"ip": "192.168.0.8"
            ,"logins": "106"
            ,"joinTime": "2016-10-14"
          }]
          //,skin: 'line' //表格风格
          ,even: true
          ,page: true //是否显示分页
          //,limits: [5, 7, 10]
          //,limit: 5 //每页默认显示的数量
        });
      });
}